package com.yesep.learn.netty.protocol.common;

/**
 * @Description: 监测数据标识
 */
public enum DATA_FLAG {
	NORMAL("N", "正常", "测量数据正常有效"), UPPER("T", "超上限", "监测浓度超仪器测量上限"), LOWER("L", "超下限", "监测浓度超仪器下限或小于检出限"), POWER_FAULT("P", "系统电源故障", "可由是否为UPS来供电进行判断"), FAULT("D", "仪器故障", "仪器故障"), COMMUNICATION_FAULT("F", "仪器通信故障", "仪器数据采集失败"), OFFLINE("B", "仪器离线", "仪器离线（数据通信正常）"), NOWATER("Z", "取水点无水样",
			"取水点没有水样或采水泵未正常上水"), MANUAL_DATA("S", "手工输入数据", "手工输入的补测值（补测数据）"), TEST_DATA("M", "维护调试数据", "在线监控（监测）仪器仪表处于维护（调试）期间产生的数据"), MEASURED_DATA("HD", "现场启动测试", "现场人员通过基站监测系统以手工即时执行的方式发出的命令，并让仪器自动完成操作，包括水样测试、标样核查测试、加标回收测试、零点核查、跨度核查等");

	private String code;//编号
	private String message;//描述
	private String remark;//备注

	private DATA_FLAG(String code, String message, String remark) {
		this.code = code;
		this.message = message;
		this.remark = remark;
	}

	public String getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}

	public String getRemark() {
		return message;
	}

	@Override
	public String toString() {
		return this.name() + "(" + this.code + " | " + this.message + " | " + this.remark + ")";
	}

	public static DATA_FLAG get(int code) {
		for (DATA_FLAG e : DATA_FLAG.values()) {
			if (e.getCode().equals(code)) {
				return e;
			}
		}
		return null;
	}
}
